package teacher.action;

import teacher.bean.Treatise;
import teacher.service.flow;
import teacher.service.treatise;

import com.opensymphony.xwork2.ActionSupport;

public class deleteTre extends ActionSupport {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private int treatiseid;
	String suc;

	public String getSuc() {
		return suc;
	}

	public void setSuc(String suc) {
		this.suc = suc;
	}

	public int getTreatiseid() {
		return treatiseid;
	}

	public void setTreatiseid(int treatiseid) {
		this.treatiseid = treatiseid;
	}

	public String execute() throws Exception {
		
		Treatise tre=new Treatise();
		tre.setTreId(treatiseid);
		if (new flow().DeleteFlow(treatiseid, 2))//删除流程
		{
			System.out.println("删除流程成功");
		}
		if(new treatise().DeleteTre(tre))
		{
			this.setSuc("success");
		return SUCCESS;}
		else{
			return ERROR;
		}
	}


	
}
